An electronic device (for example, a mobile phone) can install a large number of application programs, such as navigation software and shopping software. Generally, a user of the electronic device needs to input registration account information manually (for example, an account name and a corresponding password) to log in each of the application programs, although some application programs can store the account information for the user to log in to the application programs automatically. However, if the user does not use the stored account information to log in to the application programs within a preset time duration, the user often needs to input the account information again. If the user does not remember the account information clearly, the user cannot log in.